Tree Controls

Description

Pages about Tree Controls.

Name
Description
A Simple Tree Control

The formatting string %S=BLR% is used to specify that tree should be displayed with the familiar boxes and lines. The "B" directive indicates that open/close boxes should be displayed; the "L" directive indicates that lines should be drawn on the tree control, and the "R" directive indicates that the open/close boxes should be drawn at the root level.

Adding Images to a Tree Control

You can specify that the tree control should show images next to each entry in the tree. In addition, you can specify different images for when the branch of the tree is closed and when it is open. To use images in a tree control, you specify the list of images to use in the format string (i.e. between the % ?.% delimiters in the control definition. The syntax for specifying the images is:

Adding Navigator Icons to a Tree Control

The formatting string %S=BLR% is used to specify that tree should be displayed with the familiar boxes and lines. The "B" directive indicates that open/close boxes should be displayed; the "L" directive indicates that lines should be drawn on the tree control, and the "R" directive indicates that the open/close boxes should be drawn at the root level.

Displaying Values from a Set in a Tree Control

This sample demonstrates several different programming techniques.

Drop Down Tree Control

This example shows the drop down tree control. This code produces the following dialog box.

Setting Choices for Tree Controls

A data field displayed as a tree control or drop-down tree control accepts only values that are in its choice list. These images show a tree control in regular and drop-down formats.

Tree Control Events

In some situations, where the tree control will display a lot of data, and it would take a long time to compute all of the data to be shown in the tree control, it would be advantageous to delay populating the branches in the tree until the user actually opens that node.

Tree Controls

A tree control is a variation of a list box. The tree control is very familiar to all Windows uses as many of the standard Windows user interfaces (such as the Explorer) utilize a tree control. Like a list box, a tree control displays an array of value. In the case of the tree control however, the array of values must be specially formatted to represent the hierarchy of the tree.